#!/bin/bash
#功能函数
function setup_python()
{
  local xlrd_url="http://pypi.python.org/packages/source/x/xlrd/xlrd-0.7.1.tar.gz"
  local pyexcelerator_url="http://sourceforge.net/projects/pyexcelerator/files/pyExcelerator/0.6.4.1/pyexcelerator-0.6.4.1.zip"
  wget  $xlrd_url          --directory-prefix=/tmp/ --no-clobber
  wget  $pyexcelerator_url --directory-prefix=/tmp/ --no-clobber
  if test -f /tmp/`basename ${xlrd_url}`; then
    tar -xvf /tmp/`basename ${xlrd_url}` -C /tmp/
    echo "aaaaaa"
    cd /tmp/`basename ${xlrd_url}|sed "s@.tar.gz@@g"`
    python ./setup.py install
    echo "bbbbb"
  fi
  if test -f /tmp/`basename ${pyexcelerator_url}`; then
    cd /tmp/
    unzip `basename ${pyexcelerator_url}`
    cd -
    cd /tmp/`basename $pyexcelerator_url|sed "s@.zip@@g"`
    python setup.py install
    cd -
  fi
}

setup_python
ac_PATH=`echo $PATH |sed "s@/usr/local/bin:@@g"`
echo $ac_PATH
export PATH=`pwd`:$ac_PATH
